<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 

<h1 style="text-align:center; font-size:30; font-weight:bold; margin-top:10px">COMPARE</h1>
        <table width="888" style="text-align:center; margin:20px 40px;">
        <tr>
            <th>PRODUCTS</th>
            
            <s:iterator value="#request.products">
            	<th style="background:#fff; width:160px">
            		<s:if test="%{getSku() != null}">
			            <a href="<s:url action="detailproduct.action"><s:param name="sku" value="getSku()" /></s:url>">
			            	<img src="<s:property value="getProductImages().iterator().next().getImageUrl()" />" width="100px" height="100px" style="margin-left: 30px;"/>
			            </a>
			            <div><a href="<s:url action="detailproduct.action"><s:param name="sku" value="getSku()" /></s:url>" style="font-size:15px"><s:property value="getName()" /></a></div>
			            <div style="color:#666">Model: <span style="font-weight:bold"><s:property value="getModel()" /></span></div>
			            <div style="color:#666">SKU: <span style="font-weight:bold"><s:property value="getSku()" /></span></div>
			            <div style="color:#f00">Price: <s:property value="getPrice()" /> $</div>
			       </s:if>
            	</th>
            </s:iterator>
        </tr>
            <tr>
                <th colspan="5" style="font-size:15px;">REVIEWS</th>
            </tr>
            <tr>
            	<th>Rating</th>
                <s:iterator status="product" value="#request.products">
            		<td>
            			<s:if test="%{getRate() != null}">
            				<img src="images/rate_<s:property value="getRate()"/>.jpg" />
            				<div><s:property value="getRate()"/> of 5.0</div>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
                <th colspan="5" style="font-size:15px;">PRODUCT SPECS</th>
            </tr>
            <tr>
            	<th>Phone Style</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getPhoneStyle()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Band and Mode</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getBandAndMode()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Technology Details</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getTechnologyDetails()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Talk Time</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getTalkTime()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Standby Time</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getStandbyTime()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Battery Type</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getBatteryType()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Voice Activated</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:if test="%{getSpecifications().iterator().next().getVoiceActivated() == true}">
            					Yes
            				</s:if>
            				<s:elseif test="%{getSpecifications().iterator().next().getVoiceActivated() == false}">
            					No
            				</s:elseif>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Internet/Email Capable</th>
            	<s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:if test="%{getSpecifications().iterator().next().getInternetEmailCapable() == true}">
            					Yes
            				</s:if>
            				<s:elseif test="%{getSpecifications().iterator().next().getInternetEmailCapable() == false}">
            					No
            				</s:elseif>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Touch Screen</th>
            	<s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:if test="%{getSpecifications().iterator().next().getTouchScreen() == true}">
            					Yes
            				</s:if>
            				<s:elseif test="%{getSpecifications().iterator().next().getTouchScreen() == false}">
            					No
            				</s:elseif>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Device Manufacturer</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getDeviceBrand() != null}">
            				<s:property value="getDeviceBrand().getName()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Color Category</th>
                 <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getColorCategory()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Wireless Capability</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getWirelessCapability()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Data Plan Required</th>
            	<s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:if test="%{getSpecifications().iterator().next().getDataPlanRequired() == true}">
            					Yes
            				</s:if>
            				<s:elseif test="%{getSpecifications().iterator().next().getDataPlanRequired() == false}">
            					No
            				</s:elseif>
            			</s:if>
            		</td>
            	</s:iterator>
            	
            </tr>
            <tr>
            	<th>Mobile Operating System</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getOperatingSystem() != null}">
            				<s:property value="getOperatingSystem().getName()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Operating System</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getOperatingSystem()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Built-In GPS</th>
            	
            	<s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:if test="%{getSpecifications().iterator().next().getBuiltinGps() == true}">
            					Yes
            				</s:if>
            				<s:elseif test="%{getSpecifications().iterator().next().getBuiltinGps() == false}">
            					No
            				</s:elseif>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Screen Size (Measured Diagonally)</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getScreenSize()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Bluetooth Version</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getBluetoothVersion()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Keyboard Type</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getKeyboardType()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Front Facing Camera MP Rating</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getFrontCamera()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Rear Facing Camera MP Rating</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getRearCamera()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Warranty Terms - Parts</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getWarrantyTermsParts()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Warranty Terms - Labor</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getWarrantyTermsLabor()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Product Height</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getHeight()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Product Width</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getWidth()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Product Weight</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getWeight()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
            <tr>
            	<th>Product Depth</th>
                <s:iterator value="#request.products">
            		<td>
            			<s:if test="%{getSpecifications().iterator().hasNext() == true}">
            				<s:property value="getSpecifications().iterator().next().getDepth()"/>
            			</s:if>
            		</td>
            	</s:iterator>
            </tr>
             <tr>
                <th colspan="5" style="font-size:15px;">AVAILABILITY</th>
            </tr>
            <tr>
            	<th>Availble</th>
                
                <s:iterator status="product" value="#request.products">
            		<td>
            			<s:if test="%{isAvailable() == true}">
            				Yes
            			</s:if>
            			<s:elseif test="%{isAvailable() == false}">
            				No
            			</s:elseif>
            		</td>
            	</s:iterator>
            </tr>
    </table>